package net.entelijan.cobean.examples.showcase;

import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import net.entelijan.cobean.examples.showcase.checkbox.TogglePanel;
import net.entelijan.cobean.examples.showcase.combobox.ComboboxPanel;
import net.entelijan.cobean.examples.showcase.filesel.FileselPanel;
import net.entelijan.cobean.examples.showcase.multisel.OrderMultiselPanel;
import net.entelijan.cobean.examples.showcase.multisel.SortMultiselPanel;
import net.entelijan.cobean.examples.showcase.orderlist.MultiSelectionOrderlistPanel;
import net.entelijan.cobean.examples.showcase.orderlist.SingleSelectionOrderlistPanel;
import net.entelijan.cobean.examples.showcase.progress.ProgressPanel;
import net.entelijan.cobean.examples.showcase.table.FilterActionTablePanel;
import net.entelijan.cobean.examples.showcase.table.FilterFocusTablePanel;
import net.entelijan.cobean.examples.showcase.table.FilterKeyTablePanel;
import net.entelijan.cobean.examples.showcase.table.SortTablePanel;
import net.entelijan.cobean.examples.showcase.text.SimpleMultiFailureFieldsTextPanel;
import net.entelijan.cobean.examples.showcase.text.SimpleSingleFailureFieldTextPanel;
import net.entelijan.cobean.examples.showcase.tree.DefaultTreePanel;
import net.entelijan.cobean.examples.showcase.tree.RecursiveTreePanel;
import net.entelijan.cobean.examples.util.ExamplesUtil;
import net.miginfocom.swing.MigLayout;

public class CobeanShowcasePanel extends JPanel {

	private static final long serialVersionUID = 1L;

	// Text Panels
	private SimpleMultiFailureFieldsTextPanel simpleMultiFailureFieldsTextPanel = new SimpleMultiFailureFieldsTextPanel();
	private SimpleSingleFailureFieldTextPanel simpleSingleFailureFieldTextPanel = new SimpleSingleFailureFieldTextPanel();
	private SimpleMultiFailureFieldsTextPanel validatingTextPanel = new SimpleMultiFailureFieldsTextPanel();

	// Table panels
	private SortTablePanel sortTablePanel = new SortTablePanel();

	private FilterKeyTablePanel filterKeyTablePanel = new FilterKeyTablePanel();

	private FilterFocusTablePanel filterFocusTablePanel = new FilterFocusTablePanel();

	private FilterActionTablePanel filterActionTablePanel = new FilterActionTablePanel();

	// Multisel panels
	private SortMultiselPanel sortMultiselPanel = new SortMultiselPanel();

	private OrderMultiselPanel orderMultiselPanel = new OrderMultiselPanel();

	// Toggle panels
	private TogglePanel togglePanel = new TogglePanel();

	// Progress panels
	private ProgressPanel progressPanel = new ProgressPanel();

	// Filesel panels
	private FileselPanel fileselPanel = new FileselPanel();

	// Orderlist panels
	private SingleSelectionOrderlistPanel singleSelectionOrderlistPanel = new SingleSelectionOrderlistPanel();

	private MultiSelectionOrderlistPanel multiSelectionOrderlistPanel = new MultiSelectionOrderlistPanel();

	private ComboboxPanel beanComboboxPanel = new ComboboxPanel();

	private ComboboxPanel stringComboBoxPanel = new ComboboxPanel();

	private ComboboxPanel stringWithNullValueComboboxPanel = new ComboboxPanel();

	// Tree Panel

	private RecursiveTreePanel recursiveTreePanel = new RecursiveTreePanel();

	private DefaultTreePanel listTreePanel = new DefaultTreePanel();

	private DefaultTreePanel treePanel = new DefaultTreePanel();

	public CobeanShowcasePanel() {
		super();
		setLayout(new MigLayout());
		JTabbedPane tp = new JTabbedPane(JTabbedPane.LEFT);
		{
			JTabbedPane itp = new JTabbedPane(JTabbedPane.TOP);
			itp.add(this.simpleMultiFailureFieldsTextPanel,
					"Multiple failure textfields");
			itp.add(this.simpleSingleFailureFieldTextPanel,
					"Single failure textfield");
			itp.add(this.validatingTextPanel, "Validating text fields");
			tp.add(itp, "Text");
		}

		{
			tp.add(this.togglePanel, "Toggle");
		}
		
		{
			tp.add(this.progressPanel, "Progress");
		}
		
		
		{
			JTabbedPane itp = new JTabbedPane(JTabbedPane.TOP);
			itp.add(this.sortTablePanel, "Sorting");
			itp.add(this.filterKeyTablePanel, "Filtering (on keystroke)");
			itp.add(this.filterFocusTablePanel, "Filtering (on focus lost)");
			itp.add(this.filterActionTablePanel,
					"Filtering (on button clicked) ");
			tp.add(itp, "Table");
		}
		{
			JTabbedPane itp = new JTabbedPane(JTabbedPane.TOP);
			itp.add(this.treePanel, "Tree");
			itp.add(this.listTreePanel, "List Tree");
			itp.add(this.recursiveTreePanel, "Recursive");
			tp.add(itp, "Tree");
		}
		{
			JTabbedPane itp = new JTabbedPane(JTabbedPane.TOP);
			itp.add(this.beanComboboxPanel, "Beans");
			itp.add(this.stringComboBoxPanel, "Strings");
			itp.add(this.stringWithNullValueComboboxPanel,
					"Strings with null value");
			tp.add(itp, "Combobox");
		}
		{
			JTabbedPane itp = new JTabbedPane(JTabbedPane.TOP);
			itp.add(this.orderMultiselPanel, "Ordering");
			itp.add(this.sortMultiselPanel, "Sorting");
			tp.add(itp, "Multisel");
		}
		tp.add(this.fileselPanel, "Filesel");
		{
			JTabbedPane itp = new JTabbedPane(JTabbedPane.TOP);
			itp.add(this.singleSelectionOrderlistPanel,
					"Orderlist (single selection)");
			itp.add(this.multiSelectionOrderlistPanel,
					"Orderlist (multi selection)");
			tp.add(itp, "Orderlist");
		}

		this.add(ExamplesUtil.createIconLabel("showcase.png"), "wrap");
		this.add(tp, "grow");
	}

	public SortMultiselPanel getSortMultiselPanel() {
		return sortMultiselPanel;
	}

	public void setSortMultiselPanel(SortMultiselPanel sortMultiselPanel) {
		this.sortMultiselPanel = sortMultiselPanel;
	}

	public OrderMultiselPanel getOrderMultiselPanel() {
		return orderMultiselPanel;
	}

	public void setOrderMultiselPanel(OrderMultiselPanel orderMultiselPanel) {
		this.orderMultiselPanel = orderMultiselPanel;
	}

	public FileselPanel getFileselPanel() {
		return fileselPanel;
	}

	public void setFileselPanel(FileselPanel fileselPanel) {
		this.fileselPanel = fileselPanel;
	}

	public SingleSelectionOrderlistPanel getSingleSelectionOrderlistPanel() {
		return singleSelectionOrderlistPanel;
	}

	public void setSingleSelectionOrderlistPanel(
			SingleSelectionOrderlistPanel orderlistPanel) {
		this.singleSelectionOrderlistPanel = orderlistPanel;
	}

	public SortTablePanel getSortTablePanel() {
		return sortTablePanel;
	}

	public void setSortTablePanel(SortTablePanel sortTablePanel) {
		this.sortTablePanel = sortTablePanel;
	}

	public FilterKeyTablePanel getFilterKeyTablePanel() {
		return filterKeyTablePanel;
	}

	public void setFilterKeyTablePanel(FilterKeyTablePanel filterKeyTablePanel) {
		this.filterKeyTablePanel = filterKeyTablePanel;
	}

	public FilterFocusTablePanel getFilterFocusTablePanel() {
		return filterFocusTablePanel;
	}

	public void setFilterFocusTablePanel(
			FilterFocusTablePanel filterFocusTablePanel) {
		this.filterFocusTablePanel = filterFocusTablePanel;
	}

	public FilterActionTablePanel getFilterActionTablePanel() {
		return filterActionTablePanel;
	}

	public void setFilterActionTablePanel(
			FilterActionTablePanel filterActionTablePanel) {
		this.filterActionTablePanel = filterActionTablePanel;
	}

	public ComboboxPanel getBeanComboboxPanel() {
		return beanComboboxPanel;
	}

	public void setBeanComboboxPanel(ComboboxPanel comboBoxPanel) {
		this.beanComboboxPanel = comboBoxPanel;
	}

	public MultiSelectionOrderlistPanel getMultiSelectionOrderlistPanel() {
		return multiSelectionOrderlistPanel;
	}

	public void setMultiSelectionOrderlistPanel(
			MultiSelectionOrderlistPanel multiSelectionOrderlistPanel) {
		this.multiSelectionOrderlistPanel = multiSelectionOrderlistPanel;
	}

	public SimpleMultiFailureFieldsTextPanel getSimpleMultiFailureFieldsTextPanel() {
		return simpleMultiFailureFieldsTextPanel;
	}

	public void setSimpleMultiFailureFieldsTextPanel(
			SimpleMultiFailureFieldsTextPanel textPanel) {
		this.simpleMultiFailureFieldsTextPanel = textPanel;
	}

	public SimpleSingleFailureFieldTextPanel getSimpleSingleFailureFieldTextPanel() {
		return simpleSingleFailureFieldTextPanel;
	}

	public void setSimpleSingleFailureFieldTextPanel(
			SimpleSingleFailureFieldTextPanel simpleSingleFailureFieldTextPanel) {
		this.simpleSingleFailureFieldTextPanel = simpleSingleFailureFieldTextPanel;
	}

	public SimpleMultiFailureFieldsTextPanel getValidatingTextPanel() {
		return validatingTextPanel;
	}

	public void setValidatingTextPanel(
			SimpleMultiFailureFieldsTextPanel validatingTextPanel) {
		this.validatingTextPanel = validatingTextPanel;
	}

	public ComboboxPanel getStringComboBoxPanel() {
		return stringComboBoxPanel;
	}

	public void setStringComboBoxPanel(ComboboxPanel stringComboBoxPanel) {
		this.stringComboBoxPanel = stringComboBoxPanel;
	}

	public ComboboxPanel getStringWithNullValueComboboxPanel() {
		return stringWithNullValueComboboxPanel;
	}

	public void setStringWithNullValueComboboxPanel(
			ComboboxPanel stringWithNullValueComboBoxPanel) {
		this.stringWithNullValueComboboxPanel = stringWithNullValueComboBoxPanel;
	}

	public RecursiveTreePanel getRecursiveTreePanel() {
		return recursiveTreePanel;
	}

	public void setRecursiveTreePanel(RecursiveTreePanel filesystemTreePanel) {
		this.recursiveTreePanel = filesystemTreePanel;
	}

	public DefaultTreePanel getListTreePanel() {
		return listTreePanel;
	}

	public void setListTreePanel(DefaultTreePanel defaultTreePanel) {
		this.listTreePanel = defaultTreePanel;
	}

	public DefaultTreePanel getTreePanel() {
		return treePanel;
	}

	public void setTreePanel(DefaultTreePanel treePanel) {
		this.treePanel = treePanel;
	}

	public TogglePanel getTogglePanel() {
		return togglePanel;
	}

	public void setTogglePanel(TogglePanel togglePanel) {
		this.togglePanel = togglePanel;
	}

	public ProgressPanel getProgressPanel() {
		return progressPanel;
	}

	public void setProgressPanel(ProgressPanel progressPanel) {
		this.progressPanel = progressPanel;
	}

}
